package com.ysd.lis.controller.lab;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.lab.LabReqUnqualified;
import com.ysd.lis.request.lab.LabReqUnqualifiedDto;
import com.ysd.lis.request.lab.LabReqUnqualifiedRequest;
import com.ysd.lis.service.lab.LabReqUnqualifiedService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 不合格原因处理表 前端控制器
 * </p>
 *
 * @author Bai
 * @since 2024-02-04
 */
@RestController
@RequestMapping("/lab/req/unqualified")
public class LabReqUnqualifiedController extends BaseController {

    @Autowired
    private LabReqUnqualifiedService reqUnqualifiedService;

    @ApiOperation("获取不合格标本集合(不合格标本录入)")
    @GetMapping("/getUnqualified")
    public Result getUnqualified(LabReqUnqualifiedRequest.GetUnqualifiedParams labReqUnqualified) {
        return reqUnqualifiedService.getUnqualified(labReqUnqualified);
    }

    @ApiOperation("获取不合格标本记录")
    @PostMapping("/getUnqualifiedRecord")
    public Result getUnqualifiedRecord(@RequestBody LabReqUnqualifiedDto labReqUnqualified) {
        return reqUnqualifiedService.getUnqualifiedRecord(labReqUnqualified);
    }

    @ApiOperation("保存不合格标本")
    @PostMapping("/saveUnqualified")
    public Result saveUnqualified(@RequestBody LabReqUnqualified labReqUnqualified) {
        return reqUnqualifiedService.saveUnqualified(labReqUnqualified);

    }

    @ApiOperation("删除不合格标本")
    @GetMapping("/deleteUnqualified")
    public Result deleteUnqualified(LabReqUnqualified labReqUnqualified) {
        return reqUnqualifiedService.deleteUnqualified(labReqUnqualified);
    }

    class test{

    }
}
